package com.jxpowernode.bitcon.controllers;

import com.jxpowernode.bitcon.bean.rpcbtc.GetBlockCountHash;

import com.jxpowernode.bitcon.btcrpccode.GetBlockCount;


import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author: Lixuewei
 * @Email:1410511702@qq.com
 * @Desc:
 * @Date: 2021/12/16 22:14
 */
public class GetBlockCountController extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {

        resp.setContentType("text/html;charset=UTF-8");
        req.setCharacterEncoding("UTF-8");
        PrintWriter out = resp.getWriter();
        out.println("11");
        GetBlockCount count = new GetBlockCount();
        GetBlockCountHash blockCount = count.getBlockCount();
        System.out.println(blockCount.getResult());
        out.println(blockCount.getResult());
//        CreateBitconAdder c = new CreateBitconAdder();
//        String adder = null;
//        try {
//            adder = c.getAdder();
//            System.out.println(adder);
//            out.println(adder);
//        } catch (NoSuchProviderException e) {
//            e.printStackTrace();
//        } catch (IllegalAccessException e) {
//            e.printStackTrace();
//        }
//        String s = Address.bitconAdder();
//        System.out.println(s);
//        out.println(s);


    }
}
